package cn.com.bluemoon.daps.notice.template;

import cn.com.bluemoon.daps.notice.template.base.BaseMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Jarod.Kong
 * @date 2021/6/11 10:51
 */
@NoArgsConstructor
@Data
public class MetadataImpactMessage extends BaseMessage {
    /**
     * 头部，eg： 用户 张三@zhangsan 的开发同步DDL语句执行结束，相关信息如下：
     */
    @NotNull(message = "相关信息头部不可为空")
    private String header;

    @ApiModelProperty(value = "变更人")
    @NotEmpty(message = "变更人必填")
    private String changeUser;

    @ApiModelProperty(value = "所属系统")
    @NotEmpty(message = "系统必填")
    private String systemName;

    @ApiModelProperty(value = "变更表的Schema")
    @NotEmpty(message = "变更表schema必填")
    private String changeTableSchema;

    @ApiModelProperty(value = "变更表名")
    @NotEmpty(message = "变更表名必填")
    private String changeTableName;

    @ApiModelProperty(value = "变更脚本")
    @NotEmpty(message = "变更脚本必填")
    private String changeScript;

    @ApiModelProperty(value = "变更原因")
    @NotEmpty(message = "变更原因必填")
    private String changeReason;

    @ApiModelProperty(value = "归档表名")
    private String archiveTableName;

    @ApiModelProperty(value = "归档存储信息")
    private String archiveInfo;

    @ApiModelProperty(value = "影响分析的结果")
    @NotEmpty(message = "影响分析的结果必填")
    private String impactAnalysisResult;

    @ApiModelProperty(value = "变更类型 1-表变更 2-归档变更-表归档")
    @NotNull(message = "变更类型必填")
    private String changeType;

    @ApiModelProperty(value = "计划变更时间，格式：2022-6-21 15:03:00")
    @NotNull(message = "计划变更时间必填")
    private String planChangeTime;

    @ApiModelProperty("发送时间")
    private LocalDateTime sendTime;

    /**
     * <pre>
     * 消息尾部，eg: 1)如需处理，请登录数据资产平台：
     *         https://xxxxx.bluemoon.com.cn/data_asset_management
     *         2)本邮件仅通知，无需人工处理。
     * </pre>
     */
    @NotNull(message = "消息尾部不可为空")
    private String footer;

    @Override
    public String getMsgTemplatePath() {
        return "metadata-impact-template.html";
    }
}
